Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(doc): problematic polling operation for lro delete #1442

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

archerzz
Copy link
Member

@archerzz archerzz commented Aug 28, 2024

Currently in the offical guide, the same polling operation is shared by all lro operations, which could cause problems for some emitters since the lro metadata contains value which doesn't fit for lro delete. See Azure/autorest.csharp#4827

This commit will create a separate polling operation which fits lro delete. The same definition is already available in

@sharedRoute
@doc("Gets status of a Widget operation.")
getWidgetOperationStatus is Operations.GetResourceOperationStatus<Widget>;
@doc("Gets status of a Widget delete operation.")
@sharedRoute
getWidgetDeleteOperationStatus is Operations.GetResourceOperationStatus<Widget, never>;

Currently in the offical guide, the same polling operation is shared by all lro operations, which could cause problems for some emitters since the lro metadata contains value which doesn't fit for lro delete. See Azure/autorest.csharp#4827
This commit will create a separate polling operation which fits lro delete. The same definition is already available in https://github.com/Azure/typespec-azure/blob/955fc9534c2f7153d45c9fbe5743baa0c104d803/packages/samples/specs/data-plane/trait-versioning/main.tsp#L72-L77
@azure-sdk
Copy link
Collaborator

No changes needing a change description found.

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs

@@ -28,7 +33,7 @@ interface Widgets {
createOrUpdateWidget is Operations.LongRunningResourceCreateOrUpdate<Widget>;
Copy link
Member

@weidongxu-microsoft weidongxu-microsoft Aug 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markcowl
Is it OK for us to replace this example with LongRunningResourceCreateOrReplace?

As Azure guideline (DPG)
DO NOT implement PATCH as an LRO. If LRO update semantics are required, implement it using the LRO POST action pattern .

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated according to Weidong's comment. I can roll back to previous comment if needed.

Copy link
Contributor

@XiaofeiCao XiaofeiCao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update content below to use createOrReplace as well?

1. We change `createOrUpdateWidget` to use `LongRunningResourceCreateOrUpdate<Widget>` and `deleteWidget` to use `LongRunningResourceDelete`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants